﻿@{
    ViewBag.Title = "Issue Navigator";
}

@section headerstyle
{
<link href="@Url.Content("~/Content/themes/dashboard/issue.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/themes/datatables/datatable.css")" rel="stylesheet" type="text/css" />
<script type="text/javascript">var dropdownable = new Array();</script>
}

@section footjs
{
<script src="@Url.Content("~/Scripts/jquery.dataTables.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/std_init.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/infrastructure.js")" type="text/javascript"></script>
<script type="text/javascript">
    var dropdownController = new STD.DropdownController();
    for (var i = 0; i < dropdownable.length; i++)
        dropdownController.add(new STD.Dropdown({ trigger: dropdownable[i].trigger, layer: { container: dropdownable[i].container, content: dropdownable[i].content} }));
    $("#example").dataTable({
        "sDom": '<"top"ilp<"clear">>rt<"bottom"ilp<"clear">>',
        "sPaginationType": "full_numbers",
        "iDisplayLength": 50,
        "bFilter": false,
        "bProcessing": true,
        "bSortClasses": false,
        "bServerSide": true,
        "bLengthChange": false,
        "bAutoWidth": false,
        "fnRowCallback": function (nRow, aData, iDisplayIndex, iDisplayIndexFull) { return nRow; },
        "fnServerData": function (sSource, aoData, fnCallback) {
            var sData = JSON.stringify(aoData);
            $.ajax({
                "url": sSource,
                "data": sData,
                "type": "post",
                "success": fnCallback,
                "contentType": "application/json",
                "dataType": "json",
                "cache": false,
                "error": function (xhr, error, thrown) {
                    if (error == "parsererror") {
                        alert("DataTables warning: JSON data from server could not be parsed. " +
								    "This is caused by a JSON formatting error.");
                    }
                }
            });
        },
        "aoColumns": [
         { "bVisible": false, "bSortable": false, "bSearchable": false },
         { "sTitle": "T", "fnRender": function (oObj) { return '<a href="#" class="imagebacked icon-bug"></a>'; } },
         { "sTitle": "Key", "sWidth": "12%" },
         { "sTitle": "Summary", "sWidth": "30%" },
         { "sTitle": "Assignee", "fnRender": function (row) { var data = row.aData[row.iDataColumn]; if (data == '') data = '<em>unassigned</em>'; return data; } },
         { "sTitle": "Reporter" },
         { "sTitle": "P" },
         { "sTitle": "Status" },
         { "sTitle": "Resolution" },
         { "sTitle": "Created" },
         { "sTitle": "Updated" }
        ],
        "sAjaxSource": '@Url.Action("QueryIssues", "Issue")',
        "oLanguage": {
            "sLengthMenu": "Display _MENU_ records per page",
            "sZeroRecords": "There are no issues found ~_~",
            "sInfo": "Displaying issues _START_ to _END_ of _TOTAL_ matching issues.",
            "sInfoEmpty": "Displaying issues 0 to 0 of 0 matching issues.",
            "sInfoFiltered": "(filtered from _MAX_ total records)"
        }
    });
</script>
}

<div class="item-header" style="min-height: 24px;">
    <div id="navigator-options">
        <ul class="operations">
            <li id="view-ops-container" class="aui-dd-parent">
                <a id="viewsOptions" class="lnk icon-views aui-dd-link standard" href="@Url.Action("ViewOptions", "Issue")"><span>Views</span></a>
                <script type="text/javascript">dropdownable.push({ trigger: '#viewsOptions', container: '#view-ops-container', content: '@Url.Action("ViewOptions", "Issue")' })</script>
            </li>
            <li id="tool-ops-container" class="aui-dd-parent">
                <a id="toolsOptions" class="lnk icon-tools aui-dd-link standard" href="@Url.Action("ToolOptions", "Issue")"><span>Tools</span></a>
                <script type="text/javascript">dropdownable.push({ trigger: '#toolsOptions', container: '#tool-ops-container', content: '@Url.Action("ToolOptions", "Issue")' })</script>
            </li>
        </ul>
    </div>
    <h1 class="item-summary">Issue Navigator</h1>
</div>
<div id="iss-wrap" class="iss-nav">
    <div id="main-content" style="margin-bottom: 2em;min-width: 1%;">
        <div id="primary" class="column"></div>
        <div id="secondary" class="column">
            <div class="content rounded">
                <div class="results" style="width:100%;">
                    <div class="results-wrap">
                        <table id="example" width="100%" cellspacing="0">
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>